//
//  SBView.m
//  ZiJinLian
//
//  Created by 🐛 on 2017/4/20.
//  Copyright © 2017年 lzy. All rights reserved.
//

#import "SBView.h"

@implementation SBView

- (id)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        UIView *view=[[UIView alloc]initWithFrame:CGRectMake(0, 0, MainW-120, 28)];
        //view.backgroundColor=[UIColor blackColor];
        //view.alpha=0.2;
        [self addSubview:view];
        UIImageView*bgimag=[[UIImageView alloc]initWithFrame:view.frame];
        bgimag.image=[UIImage imageNamed:@"tab_searchbg"];
        [view addSubview:bgimag];
        UIImageView*imag=[[UIImageView alloc]initWithFrame:CGRectMake(15, 6, 16, 16)];
        imag.image=[UIImage imageNamed:@"nav_search"];
        [view addSubview:imag];
        self.textfied=[[UITextField alloc]initWithFrame:CGRectMake(imag.bsg_right+8, 4, MainW-165, 20)];
        self.textfied.placeholder=MyString(@"请输入关键词");
        self.textfied.clearButtonMode=UITextFieldViewModeWhileEditing;
        [self.textfied setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];
        [self.textfied setValue:FontAndStyle14 forKeyPath:@"_placeholderLabel.font"];
        self.textfied.textAlignment=NSTextAlignmentLeft;
        self.textfied.returnKeyType=UIReturnKeySearch;
        [self.textfied setTextColor:[UIColor whiteColor]];
        self.textfied.font=FontAndStyle14;
        [view addSubview:self.textfied];
        ViewRadius(view, 14);
    }
    return self;
}
@end
